﻿using DataServer.ApplicationLib.Services;
using DataServer.CommonLib.Models.Report;
using Microsoft.AspNetCore.Mvc;

namespace Config.WebApi.Controllers
{
    [Route("api/v1/reports")]
    [ApiController]
    public class ReportDataController : ControllerBase
    {
        private readonly IReportDataService _reportDataService;

        public ReportDataController(IReportDataService reportDataService)
        {
            _reportDataService = reportDataService;
        }

        [HttpPost("search")]
        public async Task<IActionResult> Get([FromBody] ReportDataSearchRequestDto model)
        {
            var result = await _reportDataService.SearchDataAsync(model);
            return Ok(result);
        }
    }
}